package shayu.product.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;

import io.renren.common.valid.ListValue;
import io.renren.common.validator.group.AddGroup;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.*;

/**
 * 品牌
 * 
 * @author xiaoshayu
 * @email xiaoshayu@qq.copm
 * @date 2023-05-03 22:48:57
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 品牌id
	 */
	@TableId
	@Null(message = "新增不能指定id",groups = {AddGroup.class})
	@NotNull(message = "新增必须指定品牌id",groups = {AddGroup.class})
	private Long brandId;
	/**
	 * 品牌名
	 */

	@NotBlank(message ="品牌名必须提交")
	private String name;
	/**
	 * 品牌logo地址
	 */

	@NotEmpty
	@URL(message = "logo必须是一个合格的uri地址")
	private String logo;
	/**
	 * 介绍
	 */

	@ListValue(vals={0,1})
	private String descript;
	/**
	 * 显示状态[0-不显示；1-显示]
	 */

	private Integer showStatus;
	/**
	 * 检索首字母
	 */

	@Pattern(regexp = "/[a-zA-Z]$/",message = "检索首字母必须是一个字母")
	private String firstLetter;

	/**
	 * 排序
	 */
	@NotNull
	@Min(value = 0,message = "排序必须大于0")
	private Integer sort;

}
